<?php 
include('../includes/connect.php');
?>

<html>
<head>
<title>FbApp</title>
		
		<!-- validation -->
		<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
		<link rel="stylesheet" href="../css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
		<script src="../js/jquery.validationEngine-en.js" type="text/javascript"></script>
		<script src="../js/jquery.validationEngine.js" type="text/javascript"></script>

		<script>	
		$(document).ready(function() {
			$("#addopt").validationEngine()
		});
		 function validate2fields(){
			if($("#fname").val() =="" ||  $("#lname").val() == ""){
				return false;
			}else{
				return true;
			}
		} 
		</script>
		<!-- validation end -->

</head>
<body>
		<center>
		<form name="addopt" id="addopt" method="post" action="addopt_process.php">
		<table border="1" cellpadding="2" cellspacing="0">
					<tr><td colspan="2"><B>Add Option</B></td></tr>
					<tr>
						<td>Select Question : </td>
						<td>
				
						<?php 
						$questions=mysql_query('select * from questions'); ?>
						<select name='ques' id='ques' class="validate[required]">
						<option value="">--Select--</option>
						<?php while($row=mysql_fetch_array($questions)) {?>
						<option value='<?php echo $row["qid"]; ?>'><?php echo $row["questions"]; ?></option>
						<?php } ?>	
						</select>

						</td>
					</tr>
					<tr>
						<td>Options : </td>
						<td><input type="text" name="opt" id="opt" class="validate[required] text-input" size="20"></td>
					</tr>
					
					<tr><td colspan="2"><input type="submit" value="submit"></td></tr>
					
		</table>
		</form>

			</center>
</body>
</html>